import React from 'react';
import ReactDOM from 'react-dom';
import { Provider, connect } from './store/myreact_redux'
// import { Provider, connect } from 'react-redux'
import { add } from './store/action'
import store from './store/index'
class App extends React.Component {

  render() {
    console.log('redner')
    return <div className=''>
      <h1 style={{ color: this.props.color }}>{this.props.count}</h1>
      <button onClick={() => {
        this.props.dispatch(add())
      }}>+</button>
    </div>;
  }
}
App = connect(state => {
  return {
    count: state.QQQ.count,
    color: state.WWW.color
  }
}, dispatch => {
  return {
    dispatch
  }
})(App)

ReactDOM.render(<Provider store={store}>
  <App />
</Provider>, document.getElementById('root'))